<template>
    <table>
        <tr>
            <td>级别名称</td>
            <td>
                <input type="text" v-model="AddRank.R_Name" placeholder="请输入级别名称">
            </td>
        </tr>
        <tr>
            <td></td>
            <td>  <input type="button" value="添加" @click="Saverank" ></td>
        </tr>

  

    </table>
</template>

<script setup lang="ts">
import axios from 'axios'
import {onMounted,ref} from 'vue'
import { useRouter } from 'vue-router';
const rout=useRouter();
const AddRank=ref({
 
  "R_Name": ""
})
const Saverank=()=>{
    axios.post("https://localhost:7122/api/Member/AddMemberRank",AddRank.value)
    .then(res=>{
        if(res.data>0){
            alert("添加成功");
            rout.push("/ShowMemberInfo");
        }else{
            alert("添加失败");
        }
    })
}
</script>

<style scoped>

</style>